import { ProFormColumnsType } from '@ant-design/pro-components';
import { UserType } from '@/types/user';

export const userFormItem: ProFormColumnsType<UserType>[] = [
  {
    title: '头像',
    dataIndex: 'avatar',
    valueType: 'avatar',
  },
  {
    title: '账号',
    dataIndex: 'userName',
    tip: '登录账号',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
  },
  {
    title: '用户昵称',
    dataIndex: 'name',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
  },
  {
    title: '密码',
    dataIndex: 'password',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项',
        },
      ],
    },
  },
  {
    title: '年龄',
    dataIndex: 'age',
  },
  {
    title: '手机号',
    dataIndex: 'phone',
  },
  {
    title: '邮箱',
    dataIndex: 'email',
  },
  {
    title: '备注',
    dataIndex: 'memo',
    valueType: 'textarea',
  },
];

export const userFormItemUpdate: ProFormColumnsType<UserType>[] = [
  {
    title: '头像',
    dataIndex: 'avatar',
    valueType: 'avatar',
  },
  {
    title: '账号',
    dataIndex: 'userName',
    tip: '登录账号',
    fieldProps: {
      disabled: true,
    },
  },
  {
    title: '用户昵称',
    dataIndex: 'name',
  },
  {
    title: '年龄',
    dataIndex: 'age',
  },
  {
    title: '手机号',
    dataIndex: 'phone',
  },
  {
    title: '邮箱',
    dataIndex: 'email',
  },
  {
    title: '备注',
    dataIndex: 'memo',
    valueType: 'textarea',
  },
];
